home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / doll_dressup_9.swf / scripts / frame_1 / DoAction.as
Text File  |  2007-09-26  |  7KB  |  224 lines

  1. var item_List = ["one","up","down","shoes","neck","head","hair","ear","bag","foot","eye"];
  2. var item_List_Layer = [11,10,9,5,13,18,8,20,12,1,15];
  3. var item_AllNum = 10;
  4. highest_depth = 40;
  5. setup = function()
  6. {
  7.    var _loc3_ = 0;
  8.    while(_loc3_ < item_List.length)
  9.    {
  10.       r_name = item_List[_loc3_] + "_Num";
  11.       _root[r_name] = 0;
  12.       var _loc4_ = 0;
  13.       while(_loc4_ < item_AllNum)
  14.       {
  15.          NItem = item_List[_loc3_] + "_" + (_loc4_ + 1);
  16.          _root.game_ava[NItem].odepth = _root.game_ava[NItem].getDepth();
  17.          _root.game_ava[NItem].adepth = item_List_Layer[_loc3_];
  18.          _root.game_ava[NItem].bl = 0;
  19.          _root.game_ava[NItem].xs = _root.game_ava[NItem]._xscale;
  20.          _root.game_ava[NItem].ys = _root.game_ava[NItem]._yscale;
  21.          _root.game_ava[NItem].ox = _root.game_ava[NItem]._x;
  22.          _root.game_ava[NItem].oy = _root.game_ava[NItem]._y;
  23.          _root.game_ava[NItem].kind = item_List[_loc3_];
  24.          if(_root.game_ava[NItem])
  25.          {
  26.             _root.game_ava[NItem].onPress = function()
  27.             {
  28.                if(this.bl == 1)
  29.                {
  30.                   this.swapDepths(highest_depth);
  31.                   this.startDrag();
  32.                   NumCon_F(this);
  33.                   if(this.kind == "up" or this.kind == "down" or this.kind == "one" or this.kind == "hair")
  34.                   {
  35.                      underw_F(this,1);
  36.                   }
  37.                }
  38.                else
  39.                {
  40.                   this.swapDepths(highest_depth);
  41.                   this.startDrag();
  42.                }
  43.             };
  44.             _root.game_ava[NItem].onRelease = _root.game_ava[NItem].onReleaseOutside = function()
  45.             {
  46.                if(_root.game_ava.hidden_area.hitTest(_xmouse,_ymouse))
  47.                {
  48.                   Drop(this._name);
  49.                }
  50.                else
  51.                {
  52.                   this.swapDepths(_root.game_ava[NItem].odepth);
  53.                   move_f(this._name,this.ox,this.oy);
  54.                }
  55.                this.stopDrag();
  56.             };
  57.          }
  58.          _loc4_ = _loc4_ + 1;
  59.       }
  60.       _loc3_ = _loc3_ + 1;
  61.    }
  62. };
  63. NumCon_F = function(NItem)
  64. {
  65.    trace("?NumCon_F?   " + NItem);
  66.    r_kind = NItem.kind;
  67.    _root[r_kind + "_Num"] = 0;
  68.    NItem.bl = 0;
  69. };
  70. underw_F = function(NItem, val)
  71. {
  72.    trace("∞åì∞ÿ╖" + NItem);
  73.    if(NItem.kind == "one")
  74.    {
  75.       _root.game_ava.underwear_up._visible = val;
  76.       _root.game_ava.underwear_down._visible = val;
  77.    }
  78.    else if(NItem.kind == "up")
  79.    {
  80.       _root.game_ava.underwear_up._visible = val;
  81.       if(down_Num == 0)
  82.       {
  83.          _root.game_ava.underwear_down._visible = 1;
  84.       }
  85.    }
  86.    else if(NItem.kind == "down")
  87.    {
  88.       _root.game_ava.underwear_down._visible = val;
  89.       if(up_Num == 0)
  90.       {
  91.          _root.game_ava.underwear_up._visible = 1;
  92.       }
  93.    }
  94.    else if(NItem.kind == "hair")
  95.    {
  96.       _root.game_ava.underwear_hair._visible = val;
  97.    }
  98. };
  99. move_f = function(dr_name, xx, yy)
  100. {
  101.    _root.game_ava[dr_name]._xscale = _root.game_ava[dr_name].xs;
  102.    _root.game_ava[dr_name]._yscale = _root.game_ava[dr_name].ys;
  103.    _root.game_ava[dr_name].swapDepths(_root.game_ava[dr_name].odepth);
  104.    var _loc4_ = new mx.transitions.Tween(_root.game_ava[dr_name],"_x",mx.transitions.easing.Back.easeOut,_root.game_ava[dr_name]._x,xx,10);
  105.    var _loc3_ = new mx.transitions.Tween(_root.game_ava[dr_name],"_y",mx.transitions.easing.Back.easeOut,_root.game_ava[dr_name]._y,yy,10);
  106. };
  107. Drop = function(Ndrop)
  108. {
  109.    r_kind = _root.game_ava[Ndrop].kind;
  110.    _root.game_ava[Ndrop]._x = 0;
  111.    _root.game_ava[Ndrop]._y = 0;
  112.    _root.game_ava[Ndrop]._xscale = 100;
  113.    _root.game_ava[Ndrop]._yscale = 100;
  114.    _root.game_ava[Ndrop].swapDepths(_root.game_ava[Ndrop].adepth);
  115.    trace("~~~~~~~~~~~~~~~∞£╝∞ùÑ~~~~~~~~~~~~~");
  116.    trace(_root.game_ava[Ndrop].adepth);
  117.    so2.start(0,1);
  118.    _root.game_ava[Ndrop].bl = 1;
  119.    if(_root.game_ava[Ndrop].kind == "up" or _root.game_ava[Ndrop].kind == "down")
  120.    {
  121.       if(_root.one_Num != 0)
  122.       {
  123.          r_name = _root.one_Num;
  124.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  125.          _root.game_ava[r_name].bl = 0;
  126.          _root.one_Num = 0;
  127.       }
  128.       if(_root[r_kind + "_Num"] != Ndrop)
  129.       {
  130.          r_name = _root[r_kind + "_Num"];
  131.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  132.          _root.game_ava[r_name].bl = 0;
  133.          _root[r_kind + "_Num"] = Ndrop;
  134.       }
  135.       underw_F(_root.game_ava[Ndrop],0);
  136.    }
  137.    else if(_root.game_ava[Ndrop].kind == "one")
  138.    {
  139.       if(_root.up_Num != 0 or _root.down_Num != 0)
  140.       {
  141.          r_name = _root.up_Num;
  142.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  143.          _root.game_ava[r_name].bl = 0;
  144.          r_name = _root.down_Num;
  145.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  146.          _root.game_ava[r_name].bl = 0;
  147.          _root.up_Num = 0;
  148.          _root.down_Num = 0;
  149.          _root[r_kind + "_Num"] = Ndrop;
  150.       }
  151.       if(_root[r_kind + "_Num"] != Ndrop)
  152.       {
  153.          r_name = _root[r_kind + "_Num"];
  154.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  155.          _root.game_ava[r_name].bl = 0;
  156.          _root[r_kind + "_Num"] = Ndrop;
  157.       }
  158.       underw_F(_root.game_ava[Ndrop],0);
  159.    }
  160.    else
  161.    {
  162.       if(_root[r_kind + "_Num"] != Ndrop)
  163.       {
  164.          r_name = _root[r_kind + "_Num"];
  165.          move_f(r_name,_root.game_ava[r_name].ox,_root.game_ava[r_name].oy);
  166.          _root.game_ava[r_name].bl = 0;
  167.          _root[r_kind + "_Num"] = Ndrop;
  168.       }
  169.       underw_F(_root.game_ava[Ndrop],0);
  170.    }
  171.    trace("end  " + _root.game_ava[Ndrop].bl + " : " + _root.game_ava[Ndrop] + " :" + _root[r_kind + "_Num"]);
  172. };
  173. ava_default = function()
  174. {
  175.    var _loc2_ = 0;
  176.    while(_loc2_ < item_List.length)
  177.    {
  178.       r_name = item_List[_loc2_] + "_Num";
  179.       if(_root[r_name] != 0)
  180.       {
  181.          tar = _root[r_name];
  182.          move_f(tar,_root.game_ava[tar].ox,_root.game_ava[tar].oy);
  183.          _root.game_ava[tar].bl = 0;
  184.       }
  185.       _root[item_List[_loc2_] + "_Num"] = 0;
  186.       _loc2_ = _loc2_ + 1;
  187.    }
  188.    _root.game_ava.underwear_up._visible = 1;
  189.    _root.game_ava.underwear_down._visible = 1;
  190.    _root.game_ava.underwear_hair._visible = 1;
  191. };
  192. intro = false;
  193. bt_F = function(btName, tar, num)
  194. {
  195.    btName.onRollOut = function()
  196.    {
  197.       this.gotoAndStop(1);
  198.    };
  199.    btName.onRollOver = function()
  200.    {
  201.       so1.start(0,1);
  202.       this.gotoAndStop(2);
  203.    };
  204.    btName.onRelease = function()
  205.    {
  206.       this.gotoAndStop(1);
  207.       if(tar == "nextFrame")
  208.       {
  209.          _root[tar]();
  210.       }
  211.       else
  212.       {
  213.          _root[tar](num);
  214.       }
  215.    };
  216.    btName.onPress = function()
  217.    {
  218.       this.gotoAndStop(2);
  219.    };
  220. };
  221. btName = _root.LOGO;
  222. bt_F(btName,"gotoAndStop",6);
  223. stop();
  224.